-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add L7 Antrea native NetworkPolicy datapath support #4410
Conversation
1bb79b6
to
c0318b1
Compare
Codecov Report
@@ Coverage Diff @@
## main #4410 +/- ##
==========================================
- Coverage 67.91% 65.44% -2.47%
==========================================
Files 403 402 -1
Lines 57698 58411 +713
==========================================
- Hits 39187 38229 -958
- Misses 15788 17435 +1647
- Partials 2723 2747 +24
*This pull request uses carry forward flags. Click here to find out more.
|
8dee680
to
b04d745
Compare
b04d745
to
19d54ce
Compare
71b4a77
to
f126a6b
Compare
a821312
to
28c1399
Compare
5cf3651
to
8dddc0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not finished, publishing comments so far
8dddc0e
to
22489ad
Compare
pkg/ovs/openflow/ofctrl_builder.go
Outdated
// - to match VLAN ID 0 only, the mask should be 0x1fff (openflow15.OFPVID_PRESENT | protocol.VID_MASK) | ||
// - to match all VLAN IDs, the mask should be 0x1000 (openflow15.OFPVID_PRESENT) | ||
// When VLAN ID is not 0, the mask can be nil or 0x1fff, and patch it to 0x1fff | ||
if !nonVLAN && vlanID != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vlanID != 0 && vlanMaks == nil {
}
pkg/ovs/openflow/ofctrl_builder.go
Outdated
@@ -42,8 +43,27 @@ func (b *ofFlowBuilder) MatchTunMetadata(index int, data uint32) FlowBuilder { | |||
|
|||
// MatchVLAN matches the VLAN VID. It holds the VLAN VID in its least significant 12 bits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some comments about how to use this interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match a specific VLAN
Match all VLANs
Not match any VLAN
pkg/ovs/openflow/ofctrl_builder.go
Outdated
mask = *vlanMask | ||
} | ||
var matchStr string | ||
if (mask & defaultVLANMask) == defaultVLANMask { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (mask & defaultVLANMask) == defaultVLANMask { | |
if mask == defaultVLANMask { |
if (mask & (protocol.VID_MASK | openflow15.OFPVID_PRESENT)) == (protocol.VID_MASK | openflow15.OFPVID_PRESENT) { | ||
return fmt.Sprintf("dl_vlan=%d", value&protocol.VID_MASK) | ||
} | ||
return fmt.Sprintf("vlan_tci=0x%04x/0x%04x", value&openflow15.OFPVID_PRESENT, mask&openflow15.OFPVID_PRESENT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Sprintf("vlan_tci=0x%04x/0x%04x", value&openflow15.OFPVID_PRESENT, mask&openflow15.OFPVID_PRESENT) | |
return fmt.Sprintf("vlan_tci=0x%04x/0x%04x", value&openflow15.OFPVID_PRESENT, openflow15.OFPVID_PRESENT) |
} | ||
require.NoError(t, data.podWaitForRunning(defaultTimeout, clientPodName, data.testNamespace)) | ||
|
||
serverPodName := "test-l7-http-server" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some comments about the priority of Policies
assert.NotNil(t, err) | ||
|
||
// Non-HTTP connections should be rejected by Suricata. | ||
if ip.To4() != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why IPv6 not drop?
7bbfd6f
to
c8ac822
Compare
c8ac822
to
449e8cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found two problems when testing it:
- suricata became unresponsive after running a while, no traffic is forwarded, no suricatasc command is responding; this may be related to how suricata instance is started
- restarting agent doesn't re-install existing rules, which should be handled in
syncRules
134bbb3
to
a29076a
Compare
Signed-off-by: Hongliang Liu <[email protected]>
a29076a
to
dc97f1f
Compare
/test-all |
/test-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I don't have further comments for now, and I believe the above unclosed conversations have been resolved in the latest commit.
/skip-all which have succeeded |
|
||
// prepareL7NetworkPolicyInterfaces creates two OVS internal ports. An application-aware engine will connect to OVS | ||
// through these two ports. | ||
func (i *Initializer) prepareL7NetworkPolicyInterfaces() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a
Signed-off-by: Hongliang Liu <[email protected]>
This PR depends on #4380 #4406
Signed-off-by: Hongliang Liu [email protected]